<?php 
namespace app\admin\model;
use think\Model;
use think\model\concern\SoftDelete;
/**
 * 
 */
class Admin extends Model
{
    //软删除
	use SoftDelete;
    public function login($data)
	{
		$validate = new \app\common\validate\Admin();
		 if (!$validate->scene('login')->check($data)) {
            return $validate->getError();
        }

        $result = $this->where($data)->find();
        if ($result) {
            $sessionData=[
                'id'=>$result['id'],
                
            ];
            session('admin',$sessionData);
            return 1;

        }else{
            return '用户名或者密码不正确！';

        }




    }



}